﻿
<!DOCTYPE html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>注册</title>
<!-- jQuery -->
<script src="../js/jquery.min.js"></script>
<!-- jQuery Easing -->
<script src="../js/jquery.easing.1.3.js"></script>

</head>
<body>
	<script>
		//	function regist(){
		//		var title = $("#title").val();
		//		var author = $("#author").val();
		//		var content = $("#content").val();
			//	var urlpicture = $("#urlpicture").val();
				
		//		$.ajax({
		//			url:"/NewsManager/news/addnews",
		//			type:"POST",				
		//			data:{
		//				"title":title,
		//				"author":author,
		//				"content":content,
						//"urlpicture":urlpicture,
		//				},
		//			contentType:"multipart/form-data",
		//		dataType:"json",
		//			success:function(data){
		//			window.location.href="${pageContext.request.contextPath}/news/getindex";
		//			},
		//			error:function(){
						
		//			}
		//		});
		//	}
			
			
			
    $(document).ready(function () {
//设置异步提交成功的回调函数
    var options = {
        success: function (data) {
            window.location.href="${pageContext.request.contextPath}/system/news/getindex";
        },
        error:function(data){
        	alert("请先登录!!!");
        }
    };
 
        // 将表单异步化，
        $("#form1").ajaxForm(options);
 
    });
			
		</script>


	<form action="${pageContext.request.contextPath}/system/news/addnews"
		enctype="multipart/form-data" method="post" id="form1">
		标题:<input type="text" name="title" id="title"><br /> 作者:<input
			type="text" name="author" id="author"><br /> 内容:
		<textarea name="content" id="content"></textarea>
		<br /> 图片:<input type="file" name="file" id="file"><br />

		<!-- <input type="button" value="上传" onclick="regist()" /> -->
		<input type="submit" value="上传" />
	</form>
</body>
</html>

